home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / cache / EKNT95 (.txt) < prev    next >
Encoding:
Java Class File  |  1998-09-16  |  2.0 KB  |  66 lines

  1. package com.sun.java.swing.plaf.basic;
  2.  
  3. import com.sun.java.swing.JToolBar;
  4. import java.awt.Point;
  5. import java.awt.event.ComponentEvent;
  6. import java.awt.event.MouseEvent;
  7. import java.awt.event.MouseListener;
  8. import java.awt.event.MouseMotionListener;
  9. import java.io.Serializable;
  10.  
  11. public class BasicToolBarUI$DockingListener implements MouseMotionListener, MouseListener, Serializable {
  12.    // $FF: synthetic field
  13.    BasicToolBarUI this$0;
  14.    protected JToolBar toolBar;
  15.    protected boolean isDragging;
  16.    protected Point origin;
  17.  
  18.    // $FF: synthetic method
  19.    public BasicToolBarUI$DockingListener(BasicToolBarUI this$0, JToolBar t) {
  20.       this.this$0 = this$0;
  21.       this.isDragging = false;
  22.       this.origin = null;
  23.       this.toolBar = t;
  24.    }
  25.  
  26.    public void mouseClicked(MouseEvent e) {
  27.    }
  28.  
  29.    public void mousePressed(MouseEvent e) {
  30.       this.isDragging = false;
  31.    }
  32.  
  33.    public void mouseReleased(MouseEvent e) {
  34.       if (this.isDragging) {
  35.          Point position = e.getPoint();
  36.          if (this.origin == null) {
  37.             this.origin = ((ComponentEvent)e).getComponent().getLocationOnScreen();
  38.          }
  39.  
  40.          this.this$0.floatAt(position, this.origin);
  41.       }
  42.  
  43.       this.origin = null;
  44.       this.isDragging = false;
  45.    }
  46.  
  47.    public void mouseEntered(MouseEvent e) {
  48.    }
  49.  
  50.    public void mouseExited(MouseEvent e) {
  51.    }
  52.  
  53.    public void mouseDragged(MouseEvent e) {
  54.       this.isDragging = true;
  55.       Point position = e.getPoint();
  56.       if (this.origin == null) {
  57.          this.origin = ((ComponentEvent)e).getComponent().getLocationOnScreen();
  58.       }
  59.  
  60.       this.this$0.dragTo(position, this.origin);
  61.    }
  62.  
  63.    public void mouseMoved(MouseEvent e) {
  64.    }
  65. }
  66.